package com.xbts.screen.controller;

import com.xbts.common.core.enums.DateTypeEnum;
import com.xbts.common.core.web.controller.BaseController;
import com.xbts.common.core.web.domain.AjaxResult;
import com.xbts.screen.service.IScreenServer;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author : llk
 * @Date: 2023/12/29 15:30
 */
@Api(tags = "大屏（弃用）")
@RequestMapping("/screen")
@RestController
public class ScreenController extends BaseController {

    @Resource
    private IScreenServer screenServer;

    /**
     * 业务信息
     * @return
     */
    @GetMapping("/business_information")
    public AjaxResult businessInformation(){
        return success(screenServer.businessInformation());
    }

    /**
     * 业务信息(详细)
     * @param dateTypeEnum 日期类型
     * @return
     */
    @GetMapping("/business_information_detail")
    public AjaxResult businessInformationDetail(DateTypeEnum dateTypeEnum){
        return success(screenServer.businessInformationDetail(dateTypeEnum));
    }

    /**
     * 业务信息(详细)-厂区
     * @param factoryName 厂区名称
     * @return
     */
    @GetMapping("/business_information_factory_detail")
    public AjaxResult businessInformationFactoryDetail(DateTypeEnum dateTypeEnum,@RequestParam String factoryName){
        return success(screenServer.businessInformationFactoryDetail(dateTypeEnum, factoryName));
    }

    /**
     * 品质信息
     * @return
     */
    @GetMapping("/quality_information")
    public AjaxResult qualityInformation(){
        return success(screenServer.qualityInformation());
    }

    /**
     * 产能信息
     * @return
     */
    @GetMapping("/produce_information")
    public AjaxResult produceInformation(){
        return success(screenServer.produceInformation());
    }

    /**
     * 品质信息
     * @return
     */
    @GetMapping("test")
    public AjaxResult test(){
        startPage();
        return success(screenServer.test());
    }

}
